﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace King.Engine
{
    public static class Extension
    {
        public static Vector2 Center(this Texture2D texture)
        {
            return new Vector2(texture.Width / 2, texture.Height / 2);
        }

        public static Vector2 CenterVector(this Rectangle rect)
        {
            return new Vector2(rect.Center.X, rect.Center.Y);
        }

        public static bool Contains(this Rectangle rect, Vector2 pos)
        {
            return rect.Contains(new Point((int)pos.X, (int)pos.Y));
        }
    }
}
